﻿
SET QUOTED_IDENTIFIER ON
GO

SET ANSI_NULLS ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_StaffRehab]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_StaffRehab];
GO
CREATE PROCEDURE [dbo].[sproc_StaffRehab]
    @xml xml
/*

============================================================
功能:    员工复职
参数:
    @StaffIDS nvarchar(300)        :    被复职的员工ID集合
============================================================

*/

AS
BEGIN
SET NOCOUNT ON

/*
 * XML format:
 * <staffs>
 *  <s id="" />
 * </staffs>
 */

update s 
set s.dimission = 0 
from dbo.UDS_Staff s inner join @xml.nodes('/staffs/s') R(x) on s.staff_id = R.x.value('@id', 'int');
    
END
GO